﻿<%@ Page Language="C#" MasterPageFile = "~/masters/masterPage.Master" AutoEventWireup="true" CodeBehind="JobMaster.aspx.cs" Inherits="balancescorecard.masters.JobMaster" %>

<asp:Content ID="Content1" runat="server" contentplaceholderid="body">

   
             

    <asp:ListView ID="ListView1" runat="server" DataKeyNames="job_pk" 
        DataSourceID="JobSqlDatasource" InsertItemPosition="LastItem">
        <ItemTemplate>
            <tr style="background-color:#DCDCDC;color: #000000;">
                <td>
                    <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                        Text="Delete" />
                    <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                    <asp:Label ID="job_pkLabel" runat="server" Text='<%# Eval("job_pk") %>' />
                </td>
                <td>
                    <asp:Label ID="job_titleLabel" runat="server" Text='<%# Eval("job_title") %>' />
                </td>
                <td>
                    <asp:CheckBox ID="job_activeCheckBox" runat="server" 
                        Checked='<%# Eval("job_active") %>' Enabled="false" />
                </td>
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <tr style="background-color:#FFF8DC;">
                <td>
                    <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                        Text="Delete" />
                    <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                    <asp:Label ID="job_pkLabel" runat="server" Text='<%# Eval("job_pk") %>' />
                </td>
                <td>
                    <asp:Label ID="job_titleLabel" runat="server" Text='<%# Eval("job_title") %>' />
                </td>
                <td>
                    <asp:CheckBox ID="job_activeCheckBox" runat="server" 
                        Checked='<%# Eval("job_active") %>' Enabled="false" />
                </td>
            </tr>
        </AlternatingItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" 
                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    <asp:TextBox ID="job_titleTextBox" runat="server" 
                        Text='<%# Bind("job_title") %>' />
                </td>
                <td>
                    <asp:CheckBox ID="job_activeCheckBox" runat="server" 
                        Checked='<%# Bind("job_active") %>' />
                </td>
            </tr>
        </InsertItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="itemPlaceholderContainer" runat="server" border="1" 
                            style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <tr runat="server" style="background-color:#DCDCDC;color: #000000;">
                                <th runat="server">
                                </th>
                                <th runat="server">
                                    job_pk</th>
                                <th runat="server">
                                    job_title</th>
                                <th runat="server">
                                    job_active</th>
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" 
                        style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                        <asp:DataPager ID="DataPager1" runat="server">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <EditItemTemplate>
            <tr style="background-color:#008A8C;color: #FFFFFF;">
                <td>
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                </td>
                <td>
                    <asp:Label ID="job_pkLabel1" runat="server" Text='<%# Eval("job_pk") %>' />
                </td>
                <td>
                    <asp:TextBox ID="job_titleTextBox" runat="server" 
                        Text='<%# Bind("job_title") %>' />
                </td>
                <td>
                    <asp:CheckBox ID="job_activeCheckBox" runat="server" 
                        Checked='<%# Bind("job_active") %>' />
                </td>
            </tr>
        </EditItemTemplate>
        <SelectedItemTemplate>
            <tr style="background-color:#008A8C;font-weight: bold;color: #FFFFFF;">
                <td>
                    <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                        Text="Delete" />
                    <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                    <asp:Label ID="job_pkLabel" runat="server" Text='<%# Eval("job_pk") %>' />
                </td>
                <td>
                    <asp:Label ID="job_titleLabel" runat="server" Text='<%# Eval("job_title") %>' />
                </td>
                <td>
                    <asp:CheckBox ID="job_activeCheckBox" runat="server" 
                        Checked='<%# Eval("job_active") %>' Enabled="false" />
                </td>
            </tr>
        </SelectedItemTemplate>
</asp:ListView>
    <asp:SqlDataSource ID="JobSqlDatasource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:balancescorecardConnectionString %>" 
        DeleteCommand="DELETE FROM [job] WHERE [job_pk] = @job_pk" 
        InsertCommand="INSERT INTO [job] ([job_title], [job_active]) VALUES (@job_title, @job_active)" 
        SelectCommand="SELECT [job_pk], [job_title], [job_active] FROM [job]" 
        
    UpdateCommand="UPDATE [job] SET [job_title] = @job_title, [job_active] = @job_active WHERE [job_pk] = @job_pk">
        <DeleteParameters>
            <asp:Parameter Name="job_pk" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="job_title" Type="String" />
            <asp:Parameter Name="job_active" Type="Boolean" />
            <asp:Parameter Name="job_pk" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="job_title" Type="String" />
            <asp:Parameter Name="job_active" Type="Boolean" />
        </InsertParameters>
    </asp:SqlDataSource>

   
             

</asp:Content>


